<template>
  <div>
    <h1>添加参数</h1>
    <van-field label="名称" v-model="form.name"></van-field>
    <van-field label="类型" v-model="form.type"></van-field>
    <van-field label="值" v-model="form.value"></van-field>
    <van-button @click="add">添加</van-button>

  </div>
</template>

<script>
export default {
  name: "add_parms",
  data() {
    return {
      list: [],
      form: {'id': this.$route.query.id},

    }
  },
  methods: {
    add() {
      // let dict = {}
      // dict['name'] = this.form.name
      // dict['type'] = this.form.type
      // dict['value'] = this.form.value
      // dict['id'] = this.form.id
      this.list.push(this.form)
      this.$axios.put('/day01/yewu?id=' + this.form.id, this.list)
        .then(res => {
          if (res.data.code == 200) {
            alert('添加成功')
          }
        })

    }
  }
}
</script>

<style scoped>

</style>
